package com.pinc.poop;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class PincCalendarPoopGridView extends PincCalendarGridView {
	private TextView tv_times;
	private ImageView iv_poop;

	public PincCalendarPoopGridView(Context context, AttributeSet attrs) {
		super(context, attrs);
		tv_times = (TextView) this.findViewById(R.id.tv_times);
		iv_poop = (ImageView) this.findViewById(R.id.imageView_Poop);
	}

	@Override
	protected int getColorDefault() {
		return Color.parseColor("#E0E0E0");
	}

	@Override
	protected int getLayoutResource() {
		return R.layout.day_grid;
	}

	@Override
	protected int getDayViewId() {
		return R.id.tv_Day;
	}

	public void updateDataView(int n) {
		if (n > 0)
		{
			iv_poop.setVisibility(View.VISIBLE);
			if ( n > 1)
			{
				tv_times.setVisibility(View.VISIBLE);
				tv_times.setText(String.format("(%d)", n));
			}
		}
	}

	public void clearDataView()
	{
		tv_times.setVisibility(View.GONE);
		iv_poop.setVisibility(View.GONE);
	}

}
